This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| В общем, если генерить её вот так: | |
| formula = '= ИНДЕКС({"";"сто ";"двести ";"триста ";"четыреста ";"пятьсот ";"шестьсот ";"семьсот ";"восемьсот ";"девятьсот "};ОСТАТ(ОТБР(' + row_link + '/10^8);10)+1)&ВЫБОР(ОСТАТ(ОТБР(' + row_link + '/10^7);10)+1;"";ИНДЕКС({"десять ";"одиннадцать ";"двенадцать ";"тринадцать ";"четырнадцать ";"пятнадцать ";"шестнадцать ";"семнадцать ";"восемнадцать ";"девятнадцать "};ОСТАТ(ОТБР(' + row_link + '/10^6);10)+1);"двадцать ";"тридцать ";"сорок ";"пятьдесят ";"шестьдесят ";"семьдесят ";"восемьдесят ";"девяносто ")&ЕСЛИ(ОСТАТ(ОТБР(' + row_link + '/10^7);10)<>1;ИНДЕКС({"";"один ";"два ";"три ";"четыре ";"пять ";"шесть ";"семь ";"восемь ";"девять "};ОСТАТ(ОТБР(' + row_link + '/10^6);10)+1);"")&ЕСЛИ(ОСТАТ(ОТБР(' + row_link + '/10^6);1000);"миллион"&ЕСЛИ(ОСТАТ(ОТБР(' + row_link + '/10^7);10)=1;"ов ";ВПР(ОСТАТ(ОТБР(' + row_link + '/10^6);10);{0;"ов ":1;" ":2;"а ":5;"ов "};2));"")&ИНДЕКС({"";"сто ";"двести ";"триста ";"четыреста ";"пятьсот ";"шестьсот ";"семьсот ";"восемьсот ";"девятьсот "} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module ApplicationType | |
| extend ActiveSupport::Concern | |
| module ClassMethods | |
| def model_name | |
| superclass.model_name | |
| end | |
| def name | |
| superclass.name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Doorkeeper.configure do | |
| orm :active_record | |
| resource_owner_authenticator do | |
| #здесь логика на проверку access_token присланного | |
| current_user | |
| end | |
| resource_owner_from_credentials do | |
| #здесь логика на проверку пары логин-пароль, на выходе true or false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class UserSignInType | |
| include ApplicationTypeWithoutActiveRecord | |
| attribute :login, String | |
| attribute :password, String | |
| validates :login, :password, presence: true | |
| validate :check_authenticate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Network::ActionPostType < Network::ActionPost | |
| include Concerns::DefaultPublishedToggle | |
| include Concerns::RequiredPictureType | |
| permit :published, :title, :title_en, :announcement, :announcement_en, :description, :description_en, | |
| :mobile_site_description, :mobile_site_description_en, :mobile_app_description, | |
| :mobile_app_description_en, :has_mobile_site_description, :has_mobile_site_description_en, | |
| :has_mobile_app_description, :has_mobile_app_description_en, :cafe, :delivery | |
| validates :mobile_site_description, presence: true, if: :has_mobile_site_description? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module SmsChannelRepository | |
| extend ActiveSupport::Concern | |
| include BaseRepository | |
| module ClassMethods | |
| def active | |
| find_by(active: true) | |
| end | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| HTTP status code symbols for Rails | |
| Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
| Status Code Symbol | |
| 1xx Informational | |
| 100 :continue | |
| 101 :switching_protocols | |
| 102 :processing |